﻿using AngryManagementMayhem.GameCode.Screens.MainMenuScreen;
using Transformable_Engine_v2.Engine.GameObjects.Containers;

namespace AngryManagementMayhem.GameCode
{
    public class AngryManagementMayhemGame : Container
    {
        private Screen _screen;

        public override void Initialize()
        {
            _screen = new LobbyScreen();
            _screen.OnChangeScreen += ChangeScreen;
            AddChildren(_screen);
            base.LoadContent();
        }

        void ChangeScreen(string nextScreen)
        {
            _screen.OnChangeScreen -= ChangeScreen;
            _screen.Die(1500);

            switch (nextScreen)
            {
                case "gameLobby":
                    _screen = new LobbyScreen();
                    break;
                case "createGame":
                    _screen = new CreateGameScreen();
                    break;
                case "createGame.Mode":
                    _screen = new CreateGameMode();
                    break;
                case "selectTeams":
                    _screen = new SelectTeamsScreen();
                    break;
            }

            _screen.OnChangeScreen += ChangeScreen;
            AddChildren(_screen);
            
        }
    }
}